if (!ostree_option_context_parse (context, options, &argc, &argv, OSTREE_BUILTIN_FLAG_NONE, &repo, cancellable, error))
goto out;
+ if (!ostree_ensure_repo_writable (repo, error))
+ goto out;
+
if (opt_statoverride_file)
{
if (!parse_statoverride_file (&mode_adds, cancellable, error))
if (!ostree_option_context_parse (context, options, &argc, &argv, OSTREE_BUILTIN_FLAG_NONE, &repo, cancellable, error))
goto out;
+ if (!opt_no_prune && !ostree_ensure_repo_writable (repo, error))
+ goto out;
+
if (opt_refs_only)
pruneflags |= OSTREE_REPO_PRUNE_FLAGS_REFS_ONLY;
if (opt_no_prune)
if (!ostree_option_context_parse (context, options, &argc, &argv, OSTREE_BUILTIN_FLAG_NONE, &repo, cancellable, error))
goto out;
+ if (!ostree_ensure_repo_writable (repo, error))
+ goto out;
+
if (argc < 2)
{
gchar *help = g_option_context_get_help (context, TRUE, NULL);
if (!ostree_option_context_parse (context, options, &argc, &argv, OSTREE_BUILTIN_FLAG_NONE, &repo, cancellable, error))
goto out;
+ if (!ostree_ensure_repo_writable (repo, error))
+ goto out;
+
if (argc < 2)
{
ot_util_usage_error (context, "REMOTE must be specified", error);
if (!ostree_option_context_parse (context, options, &argc, &argv, OSTREE_BUILTIN_FLAG_NONE, &repo, cancellable, error))
goto out;
+ if (!ostree_ensure_repo_writable (repo, error))
+ goto out;
+
if (argc <= 2)
{
ot_util_usage_error (context, "A ref and commit argument is required", error);
if (!ostree_option_context_parse (context, generate_options, &argc, &argv, OSTREE_BUILTIN_FLAG_NONE, &repo, cancellable, error))
goto out;
+ if (!ostree_ensure_repo_writable (repo, error))
+ goto out;
+
if (argc >= 3 && opt_to_rev == NULL)
opt_to_rev = argv[2];
if (!ostree_option_context_parse (context, apply_offline_options, &argc, &argv, OSTREE_BUILTIN_FLAG_NONE, &repo, cancellable, error))
goto out;
+ if (!ostree_ensure_repo_writable (repo, error))
+ goto out;
+
if (argc < 3)
{
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
if (opt_update)
{
+ if (!ostree_ensure_repo_writable (repo, error))
+ goto out;
+
if (!ostree_repo_regenerate_summary (repo, NULL, cancellable, error))
goto out;
}